#pragma once

#include "../LidarDriverX.h"

using namespace robosense::lidar;
typedef PointCloudT<PointXYZI> PointCloudMsg;

class LidarDriverRS : public LidarDriverX
{
public:
    LidarDriverRS(LidarConfigurationOptions *options = new LidarConfigurationOptions(), int id = 0);

private:
    RSDriverParam _rsDriverParam;

    void exceptionCallback(const Error &code);
    std::shared_ptr<PointCloudMsg> pointCloudGetCallback();
    void pointCloudPutCallback(std::shared_ptr<PointCloudMsg> pointCloudMsg);
    SyncQueue<std::shared_ptr<PointCloudMsg>> _free_cloud_queue;
    SyncQueue<std::shared_ptr<PointCloudMsg>> _stuffed_cloud_queue;
    LidarDriver<PointCloudMsg> _driver;

protected:
    void init() override;
    void dispose() override;
    void processPointCloud() override;
};